


{if $baners}
    <div id="tcs-banner-slide"><a href="http://www.macromedia.com/go/getflashplayer">Tải Flash Player cho trình duyệt của bạn.</a></div>

    <script type="text/javascript">
        var s1 = new SWFObject("{$jw_swf_file}","ngannv","100%","300","7");
        s1.addParam("allowfullscreen","false");
        s1.addVariable("overstretch","fit");//ảnh hiện full khung hình flash
        s1.addVariable("file","{$jw_xml_file}?autostart=true&transition=random");

        s1.write("tcs-banner-slide");
    </script>
    {*{foreach from=$baners item=baner}
        <div id="home_banner_{$baner.stt}" {if $baner.stt>1}style="display:none"{/if}>
            {if $baner.type==1}
                <embed width="790" height="250" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" quality="high" src="{$baner.path}"/>
                {else}
                {if $baner.url}<a href="{$baner.url}" style="margin:0;padding:0;display:block" target="_blank">{/if}
                <img width="790" height="250" border="0" src="{$baner.path}" alt=""/>
                {if $baner.url}</a>{/if}
            {/if}
        </div>
    {/foreach}*}
{/if}

<div style="padding:0" align="left">
{if $is_admin}
    {$begin_form}
    <div style="cursor:pointer;margin:10px 0" onclick="jQuery('#admin_home_banner').toggle();"><strong>Quản lý banner</strong></div>
    <div style="margin:10px 0" id="admin_home_banner" class="hide">
        {$msg}<br/>

        <strong>Up Banner: </strong>
        <input type="file" name="banner"/> <select name="hb_update">{$hb_option}</select>
        <br/>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Ảnh</strong> 790x250...( .gif , .jpg ); <b>Flash</b> 790x250... ( .swf )
        <br/><br/>
        <b>Url:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="url" value=""/> <br/>
        <b>Thời gian:</b>&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="sec" value="15"/> <input type="submit" value="Cập nhật"/>


        <table cellpadding="5" cellspacing="1" width="100%" bgcolor="#cccccc">
            <tr bgcolor="#FFFFFF">
                <th colspan="6" align="left" style="padding:3px">
                    Danh sách các Banner
                </th>
            </tr>
            <tr bgcolor="#FFFFFF">
                <td><strong>STT</strong></td>
                <td><strong>Vị trí</strong></td>
                <td><strong>Kiểu</strong></td>
                <td width="51%"><strong>Url</strong></td>
                <td><strong>Thời gian</strong></td>
                <td align="center"><strong>Thao tác</strong></td>
            </tr>
            {foreach from=$baners item=baner}
                <tr bgcolor="#FFFFFF">
                    <td width="7%">{$baner.stt}</td>
                    <td width="8%">{$baner.name}</td>
                    <td width="8%">{if $baner.type==1}Flash{else}Ảnh{/if}</td>
                    <td>{$baner.url}</td>
                    <td width="9%">{$baner.time} s</td>
                    <td width="7%" align="center"><a href="{$baner.del}" onclick="return confirm('Bạn có chắc chắn muốn xóa không?');">Xóa</a></td>
                </tr>
            {/foreach}
        </table>
    </div>
    {$end_form}
{/if}
</div>